# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.FirebaseHosting.V1beta1.Model.Release do
  @moduledoc """
   A `Release` is a particular [collection of configurations and files](sites.versions) that is set to be public at a particular time.

  ## Attributes

  *   `message` (*type:* `String.t`, *default:* `nil`) - The deploy description when the release was created. The value can be up to 512 characters.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The unique identifier for the release, in either of the following formats: - sites/SITE_ID/releases/RELEASE_ID - sites/SITE_ID/channels/CHANNEL_ID/releases/RELEASE_ID This name is provided in the response body when you call [`releases.create`](sites.releases/create) or [`channels.releases.create`](sites.channels.releases/create).
  *   `releaseTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which the version is set to be public.
  *   `releaseUser` (*type:* `GoogleApi.FirebaseHosting.V1beta1.Model.ActingUser.t`, *default:* `nil`) - Output only. Identifies the user who created the release.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Explains the reason for the release. Specify a value for this field only when creating a `SITE_DISABLE` type release.
  *   `version` (*type:* `GoogleApi.FirebaseHosting.V1beta1.Model.Version.t`, *default:* `nil`) - Output only. The configuration and content that was released.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :message => String.t() | nil,
          :name => String.t() | nil,
          :releaseTime => DateTime.t() | nil,
          :releaseUser => GoogleApi.FirebaseHosting.V1beta1.Model.ActingUser.t() | nil,
          :type => String.t() | nil,
          :version => GoogleApi.FirebaseHosting.V1beta1.Model.Version.t() | nil
        }

  field(:message)
  field(:name)
  field(:releaseTime, as: DateTime)
  field(:releaseUser, as: GoogleApi.FirebaseHosting.V1beta1.Model.ActingUser)
  field(:type)
  field(:version, as: GoogleApi.FirebaseHosting.V1beta1.Model.Version)
end

defimpl Poison.Decoder, for: GoogleApi.FirebaseHosting.V1beta1.Model.Release do
  def decode(value, options) do
    GoogleApi.FirebaseHosting.V1beta1.Model.Release.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.FirebaseHosting.V1beta1.Model.Release do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
